home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Common / CXBindCtx.h < prev    next >
Text File  |  1997-01-03  |  2KB  |  59 lines

  1. //
  2. //  XBINDCTX.H
  3. //
  4. //  Copyright (C) Microsoft Corporation, 1996
  5. //
  6.  
  7. typedef struct _XOBJECTPARAM {
  8.     struct _XOBJECTPARAM *pNextParam;
  9.     LPUNKNOWN punkObject;
  10.     OLECHAR key[1];                     //  OLECHAR key[ANYSIZE_ARRAY]
  11. }   XOBJECTPARAM, * LPXOBJECTPARAM;
  12.  
  13. class CXBindCtx:
  14.     public IBindCtx
  15. {
  16. private:
  17.     ULONG m_cRef;
  18.     BIND_OPTS m_bindopts;
  19.     LPXOBJECTPARAM m_pParamList;
  20.  
  21. public:
  22.     inline CXBindCtx();
  23.     ~CXBindCtx();
  24.  
  25.     //  *** IUnknown methods ***
  26.     STDMETHOD(QueryInterface)(REFIID riid, LPVOID *ppvObj);
  27.     STDMETHOD_(ULONG, AddRef)(void);
  28.     STDMETHOD_(ULONG, Release)(void);
  29.  
  30.     //  *** IBindCtx methods ***
  31.     STDMETHOD(RegisterObjectBound)(LPUNKNOWN punk);
  32.     STDMETHOD(RevokeObjectBound)(LPUNKNOWN punk);
  33.     STDMETHOD(ReleaseBoundObjects)(void);
  34.     STDMETHOD(SetBindOptions)(LPBIND_OPTS pbindopts);
  35.     STDMETHOD(GetBindOptions)(LPBIND_OPTS pbindopts);
  36.     STDMETHOD(GetRunningObjectTable)(LPRUNNINGOBJECTTABLE *pprot);
  37.     STDMETHOD(RegisterObjectParam)(LPOLESTR pszKey, LPUNKNOWN punk);
  38.     STDMETHOD(GetObjectParam)(LPOLESTR pszKey, LPUNKNOWN *ppunk);
  39.     STDMETHOD(EnumObjectParam)(LPENUMSTRING *ppenum);
  40.     STDMETHOD(RevokeObjectParam)(LPOLESTR pszKey);
  41.  
  42. private:
  43.     BOOL Lookup(LPOLESTR pszKey, LPXOBJECTPARAM *ppParam, BOOL fRemove);
  44.  
  45. };
  46.  
  47. inline
  48. CXBindCtx::CXBindCtx()
  49. {
  50.     //  Our implementation of the "new" operator will zero the structure so we
  51.     //  don't have to explicitly zero/null anything.
  52.     m_cRef = 1;
  53.     m_bindopts.cbStruct = sizeof(m_bindopts);
  54.     m_bindopts.grfFlags = 0;
  55.     m_bindopts.grfMode =  STGM_READWRITE;
  56.     m_bindopts.dwTickCountDeadline = 0;
  57.     m_pParamList = NULL;
  58. }
  59.